<!DOCTYPE html>
<html lang="en">
<head>
    <title>楼盘销控展示</title>
    <meta charset="utf-8">
    <link href="/plugins/echarts/common.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/style/admin.css" media="all">
    <link rel="stylesheet" href="/style/jmdf.css" media="all">
    <#setting number_format="#.##">
</head>
<body>
<!--顶部-->
<header class="header left">
    <div class="left nav">
        <ul>
            <li>&nbsp;</li>
        </ul>
    </div>
    <div class="header_center left" style="position:relative;font-weight: bold;font-size: 40px;">
        回迁房源展示[<span class="jmdf-color-red" id="housePicProjectName"></span>]
    </div>
</header>
<div class="con left">
    <div class="div_any">
        <span style="position: absolute;top: 30px;left: 50px;">
           <span class="layui-badge" style="background-color: green;font-size: 22px;padding-top: 5px;padding-bottom: 5px;width: 60px;">&nbsp;可选&nbsp;</span>
           <span class="layui-badge" style="background-color: red;font-size: 22px;padding-top: 5px;padding-bottom: 5px;width: 60px;">&nbsp;已选&nbsp;</span>
        </span>
        <div class="left div_any01" style="width:50%;">
            <div class="div_any_child" style="width:99%;height: 940px;">
                <div class="div_any_title" style="font-size: 25px;">回迁房源[<span class="jmdf-color-red" id="housePicTitle"></span>]</div>
                <div id="housePic" style="margin-top: 10px;"></div>
            </div>
        </div>
        <div class="left div_table_box" style="width:48%;">
            <div class="div_any_child" style="width:99%;height: 940px;">
                <div class="div_any_title" style="font-size: 25px;">房源情况</div>
                <div class="table" style="margin-top: 30px;height: 900px;padding-left: 20px;" id="houseHoldData"></div>
            </div>
        </div>
    </div>
</div>
<script src="/layui/layui.js" charset="utf-8"></script>
<script src="/plugins/jquery/jquery.min.js"></script>
</body>
<script>
    //定义安置项目map
    var set_map = {};
    function initMap() {
        <#if (azProjectMap??)>
            <#list azProjectMap?keys as azProjectId>
                set_map[${azProjectId}] = "${azProjectMap[azProjectId].projectName}";
            </#list>
        </#if>
    }

    //定义数组
    var azProjectIdBuildNumArray = new Array();
    //定义数组的索引
    var index = 0;
    //定义数组的长度
    var  len = 0;

    <#if (azProjectIdBuildNumList??)>
        <#list azProjectIdBuildNumList as azProjectIdBuildNum>
            azProjectIdBuildNumArray.push("${azProjectIdBuildNum}");
        </#list>
    </#if>

    len = azProjectIdBuildNumArray.length;

    function loadHousePic() {
        if (len == index) {
            index = 0;
        }
        var azProjectIdBuildNum = azProjectIdBuildNumArray[index].split("_");
        var azProjectId = azProjectIdBuildNum[0];
        var buildNum = azProjectIdBuildNum[1];
        var zsProjectIdStr = "${(zsProjectIdStr)!}";
        var azProjectName = set_map[azProjectId];
        $("#housePicTitle").html("");
        $("#housePicProjectName").html("");
        $("#housePicTitle").html(buildNum+"幢");
        $("#housePicProjectName").html(azProjectName);
        $("#housePic").html("加载中，请稍后...");
        $.get("housePic", {
            zsProjectIdStr: zsProjectIdStr,
            azProjectId: azProjectId,
            buildNum: buildNum,
            _time: new Date().getTime()
        }, function (data) {
            $("#housePic").html(data);
        });
        index++;
    }

    function loadHouseHoldData(){
        $("#houseHoldData").html("");
        $("#houseHoldData").html("加载中，请稍后...");
        $.get("houseHoldMapData", {
            zsProjectIdStr: "${(zsProjectIdStr)!}",
            azProjectIdStr: "${(azProjectIdStr)!}",
            _time: new Date().getTime()
        }, function (data) {
            $("#houseHoldData").html(data);
        });
    }

    $(function(){
        initMap();
        loadHousePic();
        loadHouseHoldData();
        setInterval('loadHousePic()', 15000);
        setInterval('loadHouseHoldData()', 15000);
    })

</script>
</html>
